﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="WebFormLabsUpdate.aspx.cs" Inherits="TempEmployees.Web.WebFormLabsUpdate"
    Title="מעבדות" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p>
        <asp:Label ID="Label1" runat="server" Text="בחר סימסטר"></asp:Label>
        <br />
        <asp:DropDownList ID="SemestersDropDown" runat="server" AutoPostBack="true" 
            onselectedindexchanged="SemestersDropDown_SelectedIndexChanged">
            <asp:ListItem Text="All" Value="0"></asp:ListItem>
        </asp:DropDownList>
    </p>
    <asp:Panel ID="GridViewPanel" runat="server">
        <asp:GridView ID="DepartmentsInfoGridView" runat="server" AllowPaging="True" 
            AllowSorting="True" DataSourceID="DepartmentsInfoDataSource" AutoGenerateColumns="false" DataKeyNames="ID">
            <Columns>
                <asp:CommandField ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" ReadOnly="true" Visible="false" />
                <asp:BoundField DataField="DepartmentName"  HeaderText="מחלקה" SortExpression="DepartmentName" ReadOnly="true" />
                <asp:BoundField DataField="RegisteredStudents" HeaderText="סטודנטים רשומים" SortExpression="RegisteredStudents" />
            </Columns>
        </asp:GridView>
        <asp:LinqDataSource ID="DepartmentsInfoDataSource" runat="server" 
            ContextTypeName="TempEmployees.DAL.EmpDatabaseDataContext" EnableUpdate="True" 
            EntityTypeName="" TableName="DepartmentsInfos" 
            Where="SemesterID == @SemesterID">
            <WhereParameters>
                <asp:ControlParameter ControlID="SemestersDropDown" DefaultValue="1" 
                    Name="SemesterID" PropertyName="SelectedValue" Type="Int32" />
            </WhereParameters>
        </asp:LinqDataSource>
    </asp:Panel>
</asp:Content>
